#include <bits/stdc++.h>

using namespace std;

const int maxn=1005;
const double eps=1e-5;
int a[maxn],b[maxn];
struct D{
	int id;double d;
	const bool operator < (const D &dd) const { return d>dd.d;}
}d[maxn];

int main(){
	int n,k;
	while(~scanf("%d%d",&n,&k)){
		if(!(n||k)) break;
		k=n-k;
		for(int i=0;i<n;i++) scanf("%d",a+i);
		for(int i=0;i<n;i++) scanf("%d",b+i);
		double l,ans;
		l=0;ans=0.2333;
		while(fabs(l-ans)>eps){
			l=ans;
			for(int i=0;i<n;i++) d[i].id=i,d[i].d=a[i]-l*b[i];
			
		}
	}
}